import axios from "axios";

// 高德地图获取位置
export const getLocation = () => {
  return axios({
    url: "https://restapi.amap.com/v3/ip?ip=114.247.50.2&output=xml&key=e785af8b5897fb366d438658f263d112",
    method: "POST",
  });
};

// 获取城市列表
export const getCityList = () => {
  return axios({
    url: "http://localhost:12345/api/city/list",
    method: "GET",
  });
};

// 搜索
export const getSearch = (keywords: string) => {
  return axios({
    url: "http://localhost:12345/api/city/search/" + keywords,
    params: {
      keywords,
    },
  });
};

// 车票列表
export const getTicketList = () => {
  return axios({
    url: "http://localhost:12345/api/train/list",
    method: "post",
  });
};
